<template>
  <el-row :gutter="5" class="panel-group">
    <el-col :xs="12" :sm="12" :lg="16">
      <el-card class="box-card" style="overflow-y:auto;height: 220px">
        <div style="width: 150px; height: 10px; background-color: var(--primary-color);position:relative;top:-15px"></div>
        <div class="title20Class">
          <svg-icon icon-class="process"/>
          部门流程
          <span style="margin-left: 80%;color: #6c6c6c"> <a href="javascript:" @click="jumpClickHandle()">>>更多</a></span>
        </div>
        <el-divider content-position="left"></el-divider>
        <el-row v-for="item in list" :key="item.id">
          <div style="line-height: 30px;height: 30px;">
            <el-col :xs="12" :sm="12" :lg="12" class="t_border">{{ item.processName }}</el-col>
            <el-col :xs="6" :sm="6" :lg="6" class="t_border">{{ item.hostDeptName }}</el-col>
            <el-col :xs="6" :sm="6" :lg="6" class="t_border">{{ item.createTime }}</el-col>
          </div>
        </el-row>
      </el-card>
    </el-col>
    <el-col :xs="12" :sm="12" :lg="8">
      <el-card class="box-card" style="overflow-y:auto;height: 220px">
        <div style="width: 150px; height: 10px; background-color: var(--primary-color);position:relative;top:-15px"></div>
        <div class="title20Class">
          <svg-icon icon-class="process"/>
          业务分类
        </div>
        <el-divider content-position="left"></el-divider>
        <el-col :xs="24" :sm="24" :lg="24">
          <el-tree
            class="filter-tree"
            :data="data"
            :props="defaultProps"
            :default-expand-all="false"
            ref="tree"
          >
          </el-tree>
        </el-col>
      </el-card>
    </el-col>
  </el-row>

</template>

<script>
import CountTo from 'vue-count-to'
import { myDeptProcess, businessGroupByClass } from '@/api/lc/index'

export default {
  components: {
    CountTo
  },
  data() {
    return {
      list: [],
      data: [],
      defaultProps: {
        children: 'children',
        label: 'label'
      }
    }
  },
  created() {
    this.getMyDeptProcess()
    this.getBusinessGroupByClass()
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    },
    /**
     * 我的部门制度
     */
    getMyDeptProcess() {
      myDeptProcess().then(res => {
        this.list = res.data
      })
    },
    /**
     * 业务分类
     */
    getBusinessGroupByClass() {
      businessGroupByClass().then(res => {
        this.data = res.data
      })
    },
    jumpClickHandle() {
      this.$router.push({ path: '/lc1/menu5', query: { docId: 112233, docDesc: 'doc' } })
    }
  }
}
</script>

<style lang="scss" scoped>
.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
    text-align: center;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}

.t_border {
  border-bottom: 1px solid #ebeef5;
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
